package com.bms.api.bussiness.city.web;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.bms.common.base.common.bean.Result;
import com.bms.common.base.web.BaseController;
import com.bms.common.bussiness.city.entity.City;
import com.bms.common.bussiness.city.service.ICityService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 * 赛事表 前端控制器
 * </p>
 *
 * @author xj
 * @since 2018-08-15
 */
@RestController
@RequestMapping("city")
@Api(value="City-Api",tags="城市接口")
public class CityController extends BaseController{

	@Autowired
	private ICityService cityService;
	
	@PostMapping("list")
	@ApiOperation(value = "热门城市列表")
	public Result list( @RequestParam(defaultValue = "1",required=false)Integer pageNum,
			  			@RequestParam(defaultValue = "10",required=false)Integer pageSize){
		return json(cityService.selectPage(new Page<>(pageNum, pageSize), new EntityWrapper<City>().eq("hot", 1).orderBy("update_time", false)));
	}
	
}

